package com.py.credit.dao;

import com.py.credit.entity.LyObj;
import com.py.credit.entity.TreeObj;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface LyDao {

    /**
     * 查询普通措施列表
     *
     * @param jclb
     * @param name
     * @return
     */
    List<TreeObj> selectCswhTreeList(@Param(value = "jclb") String jclb,
                                     @Param(value = "name") String name);

    /**
     * 查询公共措施列表
     *
     * @param jclb
     * @param name
     * @return
     */
    List<TreeObj> selectGgCswhTreeList(@Param(value = "jclb") String jclb,
                                       @Param(value = "name") String name);

    /**
     * 查询领域列表
     *
     * @param type
     * @return
     */
    List<Map<String, String>> selectLyList(@Param(value = "type") String type);

    /**
     * 查询领域树
     *
     * @param type
     * @param name
     * @return
     */
    List<TreeObj> selectLyTreeList(@Param(value = "type") String type,
                                   @Param(value = "name") String name);
    List<TreeObj> selectLyTreeListByLy(@Param(value = "type") String type,
            @Param(value = "name") String name);
    List<TreeObj> selectLyTreeListByCs(@Param(value = "type") String type,
            @Param(value = "name") String name);

    /**
     * 查询部门树
     *
     * @param type
     * @param name
     * @return
     */
    
    List<TreeObj> selectDeptTreeList(@Param(value = "type") String type,
            @Param(value = "name") String name);
    
    
    List<TreeObj> selectDeptTreeListByDept(@Param(value = "type") String type,
                                     @Param(value = "name") String name);
    List<TreeObj> selectDeptTreeListByMeas(@Param(value = "type") String type,
            @Param(value = "name") String name);


    /**
     * 添加领域
     *
     * @param name
     * @param code
     * @param type
     * @param pId
     * @param rId
     * @param sort
     */
    void add(@Param(value = "name") String name,
             @Param(value = "code") String code,
             @Param(value = "type") String type,
             @Param(value = "pId") int pId,
             @Param(value = "rId") int rId,
             @Param(value = "sort") int sort);

    /**
     * 删除领域
     *
     * @param isDel
     * @param id
     */
    void del(@Param(value = "isDel") String isDel,
             @Param(value = "id") String id);

    /**
     * 是否有相同的code
     *
     * @param id
     * @param name
     * @param code
     * @return
     */
    int selectSameCode(@Param(value = "id") String id,
                       @Param(value = "name") String name,
                       @Param(value = "code") String code);

    /**
     * 修改领域
     *
     * @param id
     * @param name
     * @param code
     * @param type
     * @param pId
     * @param rId
     * @param sort
     */
    void update(@Param(value = "id") String id,
                @Param(value = "name") String name,
                @Param(value = "code") String code,
                @Param(value = "type") String type,
                @Param(value = "pId") int pId,
                @Param(value = "rId") int rId,
                @Param(value = "sort") int sort);

    /**
     * 领域详情
     *
     * @param id
     * @return
     */
    LyObj selectLy(@Param(value = "id") String id);
}

